//
//  JoinUserTableViewCell.m
//  ECBBusinessCamp
//
//  Created by rimi on 16/6/21.
//  Copyright © 2016年 邓毕华. All rights reserved.
//

#import "JoinUserTableViewCell.h"

#define LABELFONTSIZE 20

@implementation JoinUserTableViewCell

//#pragma mark 🌷🌷🌷life cycle🌷🌷🌷
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.backgroundColor = RGB_COLOR(245, 245, 245, 1);
        
        // 添加视图
        [self addSubview:self.nameLabel];
        [self addSubview:self.phoneLabel];
        [self addSubview:self.companyNameLabel];
        [self addSubview:self.positionLabel];
        [self addSubview:self.addressLabel];
        
        // 自动布局
        [_nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self);
            make.left.offset(SCREEN_WIDTH * 0.06);
        }];
        [_phoneLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self);
            make.left.offset(SCREEN_WIDTH * 0.15);
        }];
        [_companyNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self);
            make.left.offset(SCREEN_WIDTH * 0.36);
        }];
        [_positionLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self);
            make.left.offset(SCREEN_WIDTH * 0.58);
        }];
        [_addressLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self);
            make.left.offset(SCREEN_WIDTH * 0.78);
        }];
    }
    return self;
}

#pragma mark 🌷🌷🌷getters and setters🌷🌷🌷
- (UILabel *)nameLabel {
    if (!_nameLabel) {
        _nameLabel = [[UILabel alloc] init];
        _nameLabel.font = [UIFont systemFontOfSize:LABELFONTSIZE];
    }
    return _nameLabel;
}
- (UILabel *)phoneLabel {
    if (!_phoneLabel) {
        _phoneLabel = [[UILabel alloc] init];
        _phoneLabel.font = [UIFont systemFontOfSize:LABELFONTSIZE];
    }
    return _phoneLabel;
}
- (UILabel *)companyNameLabel {
    if (!_companyNameLabel) {
        _companyNameLabel = [[UILabel alloc] init];
        _companyNameLabel.font = [UIFont systemFontOfSize:LABELFONTSIZE];
    }
    return _companyNameLabel;
}
- (UILabel *)positionLabel {
    if (!_positionLabel) {
        _positionLabel = [[UILabel alloc] init];
        _positionLabel.font = [UIFont systemFontOfSize:LABELFONTSIZE];
    }
    return _positionLabel;
}
- (UILabel *)addressLabel {
    if (!_addressLabel) {
        _addressLabel = [[UILabel alloc] init];
        _addressLabel.font = [UIFont systemFontOfSize:LABELFONTSIZE];
    }
    return _addressLabel;
}

@end
